﻿Imports BUS
Public Class frmxlcapnhatnhasanxuat

    Private _MaNhaSanXuat As Integer
    Public Property MaNhaSanXuat() As Integer
        Get
            Return _MaNhaSanXuat
        End Get
        Set(ByVal value As Integer)
            _MaNhaSanXuat = value
        End Set
    End Property

    Private Sub frmxlcapnhatnhasanxuat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub SimpleButton_DongY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_DongY.Click
        If TextEdit_TenNhaSanXuat.Text <> "" Then
            Dim sql As String = "Update NHASANXUAT Set TenNhaSanXuat=" + "'" + TextEdit_TenNhaSanXuat.Text + "'" + " Where MaNhaSanXuat=" + _MaNhaSanXuat.ToString()
            Dim bus As New NhaXuatBanBUS()
            Dim kq As Integer = bus.CapNhatNhaXuatBan(sql)
            If kq = 1 Then
                MessageBox.Show("Câp nhật thành công !")
                Me.Close()
            Else
                MessageBox.Show("Cập nhật thất bại !")
            End If
        Else
            MessageBox.Show("Nhập tên Nhà Sản Xuất !")
        End If
    End Sub

    Private Sub SimpleButton_Thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_Thoat.Click
        Close()
    End Sub
End Class